const { db, obd_collection } = require('../config')
exports.main = async (event, context) => {
  const data = event.data;
  const pageSize = 1000;
  const page = data.page || 0;

  const lists = await db.collection(obd_collection)
    .skip(page * pageSize)
    .limit(pageSize)
    .get();

  // console.log(lists)
  return { data: lists.data };

}